#include <cstdio>
#include <cstring>

int main( )
{
    int f[ 11 ], n, m, d, p, i, ans;
    while ( scanf("%d%d", &n, &m) != EOF )
    {
        if ( n == 0 && m == 0 ) break;
        memset( f, 0, sizeof( f ) );
        ans = 0;
        for ( i = 0; i < n; i++ )
        {
            scanf("%d%d", &d, &p);
            f[ p ] += d;
            ans += d * p;
        }
        i = 10;
        while ( i && m )
        {
            if ( f[ i ] <= m )
            {
                m -= f[ i ];
                ans -= f[ i ] * i;
            }
            else
            {
                ans -= m * i;
                m = 0;
            }
            i--;
        }
        printf("%d\n", ans);
    }
    return 0;
}
